Optimal. Leaf size=107 \[ \frac {(2 A+3 C) \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {(A+2 C) \tan (c+d x)}{a d}+\frac {(2 A+3 C) \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {(A+C) \sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4170, 3872,
3852, 8, 3853, 3855} \begin {gather*} -\frac {(A+2 C) \tan (c+d x)}{a d}+\frac {(2 A+3 C) \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {(A+C) \tan (c+d x) \sec ^2(c+d x)}{d (a \sec (c+d x)+a)}+\frac {(2 A+3 C) \tan (c+d x) \sec (c+d x)}{2 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 3872
Rule 4170
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=-\frac {(A+C) \sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \sec ^2(c+d x) (a (A+2 C)-a (2 A+3 C) \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {(A+C) \sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}-\frac {(A+2 C) \int \sec ^2(c+d x) \, dx}{a}+\frac {(2 A+3 C) \int \sec ^3(c+d x) \, dx}{a}\\ &=\frac {(2 A+3 C) \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {(A+C) \sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}+\frac {(2 A+3 C) \int \sec (c+d x) \, dx}{2 a}+\frac {(A+2 C) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{a d}\\ &=\frac {(2 A+3 C) \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {(A+2 C) \tan (c+d x)}{a d}+\frac {(2 A+3 C) \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {(A+C) \sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(316\) vs. \(2(107)=214\).
time = 3.33, size = 316, normalized size = 2.95 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \cos (c+d x) \left (A+C \sec ^2(c+d x)\right ) \left (-4 (A+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \left (-2 (2 A+3 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 A \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {4 C \sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{a d (A+2 C+A \cos (2 (c+d x))) (1+\sec (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 135, normalized size = 1.26
method | result | size |
derivativedivides | \(\frac {-A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3 C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\left (-\frac {3 C}{2}-A \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\left (\frac {3 C}{2}+A \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) | \(135\) |
default | \(\frac {-A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3 C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\left (-\frac {3 C}{2}-A \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 C}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\left (\frac {3 C}{2}+A \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) | \(135\) |
norman | \(\frac {\frac {\left (A +2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {\left (A +C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {3 \left (A +2 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (3 A +7 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {\left (2 A +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a d}+\frac {\left (2 A +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a d}\) | \(166\) |
risch | \(-\frac {i \left (2 A \,{\mathrm e}^{4 i \left (d x +c \right )}+3 C \,{\mathrm e}^{4 i \left (d x +c \right )}+3 C \,{\mathrm e}^{3 i \left (d x +c \right )}+4 A \,{\mathrm e}^{2 i \left (d x +c \right )}+5 C \,{\mathrm e}^{2 i \left (d x +c \right )}+C \,{\mathrm e}^{i \left (d x +c \right )}+2 A +4 C \right )}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{a d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{a d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 a d}\) | \(202\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 239 vs.
\(2 (103) = 206\).
time = 0.29, size = 239, normalized size = 2.23 \begin {gather*} -\frac {C {\left (\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac {2 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 2 \, A {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.02, size = 152, normalized size = 1.42 \begin {gather*} \frac {{\left ({\left (2 \, A + 3 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, A + 3 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left ({\left (2 \, A + 3 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, A + 3 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, {\left (A + 2 \, C\right )} \cos \left (d x + c\right )^{2} + C \cos \left (d x + c\right ) - C\right )} \sin \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{3} + a d \cos \left (d x + c\right )^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {A \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{4}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 130, normalized size = 1.21 \begin {gather*} \frac {\frac {{\left (2 \, A + 3 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {{\left (2 \, A + 3 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {2 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} + \frac {2 \, {\left (3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.67, size = 106, normalized size = 0.99 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (A+\frac {3\,C}{2}\right )}{a\,d}-\frac {C\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-3\,C\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+C\right )}{a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________